Repository navigation
ProjectionView: pass the renderer status and painting to the embedder - #146
Merged
Merged
Conversation
useProjection's onRendererStatusChange and onPainted (#122) weren't ProjectionView props, so a host using the prebuilt view still had to observe its data-renderer-status attribute. The view now takes both and forwards them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change exposing renderer-status and paint callbacks through ProjectionView.
No open issues 🎉
What changed in this PR
Exposes the status and paint callbacks added to useProjection in #122 through ProjectionView, allowing embedders to receive these events without observing DOM attributes.
Changes:
- Adds typed
onRendererStatusChangeandonPaintedprops and forwards them touseProjection. - Adds a regression test confirming both callbacks pass through unchanged.
- Documents the callbacks alongside the view’s other integration props.
| File | Description |
|---|---|
packages/host/core/test/paint.test.mjs |
Tests callback forwarding through viewOptions. |
packages/host/core/src/ui/view/props.ts |
Declares and documents both callback props. |
packages/host/core/src/ui/view/options.ts |
Forwards both callbacks to the controller options. |
docs/guides/host-ui.md |
Documents event-based integration for embedders. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#122 added
onRendererStatusChangeandonPaintedtouseProjection's options, butProjectionViewdidn't take them as props. So a host using the prebuilt view still had to watch itsdata-renderer-statusattribute to learn when the renderer drew or failed. A hosted carousel does exactly that with aMutationObserver, and will move to these props.packages/host/core/src/ui/view/props.ts:ProjectionViewPropsgainsonRendererStatusChangeandonPainted.packages/host/core/src/ui/view/options.ts:viewOptionsforwards both touseProjection.docs/guides/host-ui.mdlists them with the view's other integration props.Test:
paint.test.mjschecks thatviewOptionspasses both callbacks through.tools check --fastpasses.